Skip Headers

Oracle® Database Backup and Recovery Reference 10g Release 2 (10.2) Part Number B14194-03 |
Home | Book List | Contents | Index | Master Index | Feedback

Previous | Next
| View PDF

# CROSSCHECK

Syntax

crosscheck::=

Description of the illustration crosscheck.gif

maintSpec::=

Description of the illustration maintspec.gif

Purpose

To verify the status of backups and copies recorded in the RMAN repository against media such as disk or tape. The `CROSSCHECK` command only processes files created on the same device type as the channels running the crosscheck.

Status of RMAN Backups

The `CROSSCHECK` command checks only objects marked `AVAILABLE` or `EXPIRED` by examining the files on disk for `DISK` channels or by querying the media manager for `sbt` channels. Table 2-2 describes the meaning of each status.

Table 2-2 Meaning of Crosscheck Status

Status | Description
--- | ---
`EXPIRED` | Object is not found either in file system (for `DISK`) or in the media manager (for `sbt`). Note that for a backup set to be `EXPIRED`, all backup pieces in the set must be `EXPIRED`. Note: `EXPIRED` does not mean the same as `OBSOLETE`.
`AVAILABLE` | Object is available for use by RMAN. For a backup set to be `AVAILABLE`, all backup pieces in the set must have the status `AVAILABLE`.
`UNAVAILABLE` | Object is not available for use by RMAN. For a backup set to be `UNAVAILABLE`, all backup pieces in the set must have the status `UNAVAILABLE`.

The `CROSSCHECK` command does not delete any files that it is unable to find, but updates their repository records to `EXPIRED`. Then, you can run DELETE `EXPIRED` to remove the repository records for all expired files as well as any existing physical files whose records show the status `EXPIRED`.

If some backup pieces or copies were erroneously marked as `EXPIRED`, for example, because the media manager was misconfigured, then after ensuring that the files really do exist in the media manager, run the `CROSSCHECK` `BACKUP` command again to restore those files to `AVAILABLE` status.

See Also: Oracle Database Backup and Recovery Basics to learn how to manage target database records in the catalog

Restrictions and Usage Notes

- The target instance must be started.

- A maintenance channel is not required when `CROSSCHECK` is used with a file that is on disk. However, if you run `CROSSCHECK` on files stored on a media manager, and you have not configured automatic channels for the media manager, then you must manually allocate maintenance channels for these objects. For example, if you created a backup on an `sbt` channel, but have not configured automatic channels for your `sbt` device, then you must manually allocate an `sbt` channel before the `CROSSCHECK` command can check the backup.

- Crosscheck validates all specified backups and copies, even if they were created in prior incarnations (that is, before the most recent `OPEN` `RESETLOGS`).

Keywords and Parameters

Syntax Element | Description
--- | ---
maintSpec | Crosschecks files output by the `BACKUP` command. For `maintSpec` options, refer to the parameter descriptions in "maintSpec".

Examples

Crosschecking All Backups and Copies: Example The following example, which assumes that the default configured channel is `DEVICE` `TYPE` `sbt`, queries the status of all backups and copies on tape and disk. Because RMAN preconfigures a disk channel, you do not need to manually allocate a disk channel:

    CROSSCHECK BACKUP; # crosschecks backup sets and image copies

Crosschecking Within a Range of Dates: Example The following example queries the media manager for the status of the backup sets in a given six month range. Note that RMAN uses the date format specified in the `NLS_DATE_FORMAT` parameter, which is '`DD-MON-YY`' in this example:

    # if you manually allocate an sbt channel, then RMAN does not crosscheck disk
    ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE sbt;
    CROSSCHECK BACKUP
      COMPLETED BETWEEN '01-JAN-01' AND '01-SEP-01';
    RELEASE CHANNEL;

    # to crosscheck only disk, specify CROSSCHECK DEVICE TYPE DISK
    CROSSCHECK BACKUP DEVICE TYPE DISK
      COMPLETED BETWEEN '01-JAN-01' AND '01-SEP-01';

    # assuming that the default channel is sbt, you can crosscheck on both disk
    # and sbt backups by simply running CROSSCHECK with the default channels
    CROSSCHECK BACKUP COMPLETED BETWEEN '01-JAN-01' AND '01-SEP-01';